<?php
	function print_torrents()
	{
		$db = new db_Connection();
		$db->Connect();

		$sql = "SELECT * FROM Torrent";
		$result = mysql_query($sql) or die('Query failed: ' . mysql_error());	
		while($line = mysql_fetch_array($result, MYSQL_ASSOC))
		{
			echo "<tr>";
			
			echo "<td>";
			echo "<a href=\"download.php?hash=".$line["INFO_HASH"]."\">".$line["Name"]."</a>";
			echo "</td>";

			echo "<td>";
			echo $line["Size"];
			echo "</td>";

			echo "<td>";
			echo $line["Added"];
			echo "</td>";

			echo "<td>";
			echo $line["UploadedBy"];
			echo "</td>";

			echo "</tr>";
		}
		
		if($result)
			mysql_free_result($result);		
	}
?>